package user

import (
	v1 "gitcode.com/G-YT/baoyou/server/api/v1"
	"github.com/gin-gonic/gin"
)

type UserRouter struct {
}

func (u *UserRouter) InitUserRouter(Router *gin.RouterGroup, pub *gin.RouterGroup) {
	baseRouter := pub.Group("base")
	userRouter := Router.Group("user")
	userApi := v1.ApiGroupApp.UserApiGroup.UserApi
	{
		baseRouter.POST("passwordLogin", userApi.PasswordLogin) // 密码登录
		baseRouter.POST("codeLogin", userApi.CodeLogin)         // 验证码登录
		baseRouter.POST("oneClickLogin", userApi.OneClickLogin) // 一键登录
	}
	{
		userRouter.POST("setPassword", userApi.SetPassword)      // 设置密码
		userRouter.POST("changePhone", userApi.ChangePhone)      // 更换手机号
		userRouter.GET("getUserData", userApi.GetUserData)       // 获取用户信息
		userRouter.PUT("updateUserData", userApi.UpdateUserData) // 修改用户信息
	}
}
